{extend name="template/base_default2"}
{block name="header"}
<link rel="stylesheet" href="__CSS__/common.css">
<link rel="stylesheet" href="__CSS__/weui.min.css">
<link rel="stylesheet" href="__CSS__/index.css">
<link rel="stylesheet" href="__CSS__/weuix.min.css"/>
<script src="__JS__/lrz.min.js"></script>
<style>

    .form-head{
        color: white;
        font-size: 16px;
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 5px;
        overflow: hidden;
    }
    body{
        background-image:url("__IMG__/bj.png");
        background-repeat:no-repeat;
        background-size:cover;
        text-align: center;
    }
</style>
{/block}
{block name="body"}
<form action="{:url('login/register')}" method="post" style="width:95%;margin: auto">
    <div class="form-head">
        <div class="form-input3" >
            <label for="name" class="form-input3-label">车主姓名:</label>
            <input class="form-input3-input" id="name" name="name" type="text" value="" placeholder=" ">
        </div>
        <div class="form-input3">
            <label for="sex" class="form-input3-label">车牌号码:</label>
            <input class="form-input3-input" name="sex" id="sex" type="text" value="">
        </div>
        <div class="form-input3">
            <label for="name" class="form-input3-label">手机号码:</label>
            <input class="form-input3-input" id="content" name="content" type="text" value="" placeholder="">
        </div>


    </div>
    <div class="form-body">

        <div class="idphoto-box headimgurl2" >
            <input class="weui_uploader_input headimgurl" type="file" accept="image/jpg,image/jpeg,image/png,image/gif"   />
            <input  type="hidden" value="11" />
        </div>
        <div class="idphoto-box headimgurl2" style="background-image: url('__IMG__/sfzz.png')">
            <input class="weui_uploader_input headimgurl" type="file" accept="image/jpg,image/jpeg,image/png,image/gif"   />
            <input  type="hidden"  value="11" />
        </div>
        <div class="idphoto-box headimgurl2" >
            <input class="weui_uploader_input headimgurl" type="file" accept="image/jpg,image/jpeg,image/png,image/gif"  />
            <input  type="hidden"   value="11" />
        </div>
        <div class="idphoto-box headimgurl2" >
            <input class="weui_uploader_input headimgurl" type="file" accept="image/jpg,image/jpeg,image/png,image/gif"  />
            <input  type="hidden"   value="11" />
        </div>
        <div class="idphoto-box headimgurl2" >
            <input class="weui_uploader_input headimgurl" type="file" accept="image/jpg,image/jpeg,image/png,image/gif"  />
            <input  type="hidden"   value="11" />
        </div>
        <div class="tips-box ">
            <p style="color:#F5E20A">温馨提示：</p>
            <p style="color:#aaaaaa">
                所有照片横向拍摄避免阴影和反光
            </p>
        </div>
    </div>
    <div class="form-input">
        <button id="submit" class="login-btn2" type="button">提交</button>
    </div>
</form>
<script type="text/javascript" src="__JS__/zepto.min.js"></script>
<script>

    $(function(){

        $('.headimgurl').change(function () {
            var v_this = $(this);
            lrz(this.files[0],{width:640,fieldName:"image"}).then(function (rst) {
                var formdata = new FormData();
                v_this.parent().css("background-image","url("+rst.base64+")");//无论是否上传成功都显示
                url = getBaseUrl()+"/web.php/file/upload_picture_base64";
                formdata.append("image", rst.base64);
                $.ajax({
                    url : url,
                    type : 'post',
                    data : formdata,
                    contentType : false,
                    processData : false,
                    dataType : "json",
                    success : function(data) {
                        if (data.status == true) {
                            $.toast("图片上传成功");
                            v_this.next().val(data.info[0]['id']);
                        }
                    },
                    error:function(){
                        $.toast("图片上传失败");
                    }
                });
                return false;
            })
        });
    })

</script>
{/block}
{block name="footer"}
<script type="text/javascript" src="__JS__/public.js"></script>
{/block}